package service.impl;

import dao.UserDao;
import dao.impl.UserDaoimpl;
import pojo.User;
import service.UserService;

import java.util.List;

public class UserServiceimpl implements UserService {
    UserDao userDao=new UserDaoimpl();

//    @Override
//   public List<User> findAll(User user) {
//      List<User> users = userDao.findAll(user);
//        return users;
//   }

    @Override
    public List<User> findAll(User user, int offset, int pageSize) {
        List<User> users = userDao.findAll2(user,offset,pageSize);
        return users;

    }

    @Override
    public int count(User user) {
        return userDao.count(user);
    }

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public User findUserById(int id) {
        return userDao.findUserById(id);
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public int deleteUserById(int id) {
        return userDao.deleteUserById(id);
    }
}
